﻿// -----------------------------------------------------------------------
// <copyright file="App.cs" company="R&R">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

#region Imports
using System;
using System.Configuration;
using System.Threading;
using System.Windows;
#endregion Imports

namespace Domino
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        /// <summary>
        /// Application pre-entry activities
        /// </summary>
        [STAThread()]
        static void Main()
        {
            int splashDuration = -1;
            if (!Int32.TryParse(ConfigurationManager.AppSettings["SplashDuration"], out splashDuration)) splashDuration = 0;

            Splasher.Splash = new Splash();
            Splasher.ShowSplash(splashDuration);

            new App();
        }

        /// <summary>
        /// Application entry point
        /// </summary>
        public App()
        {
            try
            {
                StartupUri = new Uri(@"Views\GameBoard.xaml", UriKind.Relative);
                Run();
            }
            catch (Exception ex)
            {
                MessageBox.Show(String.Format("{0}\r\n\r\n{1}", ex.Message, ex.StackTrace), "Unhandled exception..");
            }
        }
    }
}